import request from '@/utils/request'
import downloadRequest from '@/utils/downloadRequest'

// 查询列表数据
export function load(data) {
  return request({
    url: '/media/ad_media/load_media',
    method: 'post',
    data
  })
}

// 上传文件
export function uploadCover(data) {
  return request({
    url: '/media/ad_media/upload_media_cover',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/media/ad_media/update_media',
    method: 'post',
    data
  })
}

export function uploadVideo(data) {
  return request({
    url: '/media/ad_media/upload',
    method: 'post',
    data
  })
}

// 导出excel
export function downExcel(data) {
  return downloadRequest({
    url: '/media/ad_media/export_excel',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 删除媒体文件
export function remove(data) {
  return request({
    url: '/media/ad_media/remove_media',
    method: 'post',
    data
  })
}

// 获取详情
export function getDetail(data) {
  return request({
    url: '/media/ad_media/find_media_detail',
    method: 'post',
    data
  })
}
